#pragma once

class CAccountMng : public CDialogImpl<CAccountMng>, public CWinDataExchange<CAccountMng>
{
public:
	enum { IDD = IDD_DIALOG_ACCOUNT };

	BEGIN_MSG_MAP(CAccountMng)
		MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
		COMMAND_ID_HANDLER(IDOK, OnOK)
		COMMAND_ID_HANDLER(IDCANCEL, OnCancel)
		COMMAND_HANDLER(IDC_BUTTON_ADD_USER, BN_CLICKED, OnBnClickedButtonAddUser)
		COMMAND_HANDLER(IDC_BUTTON_DEL_USER, BN_CLICKED, OnBnClickedButtonDelUser)
    END_MSG_MAP()


	BEGIN_DDX_MAP(CAccountMng)
		DDX_CONTROL_HANDLE(IDC_LIST_ACCOUNT, m_lcAccount)
		DDX_TEXT(IDC_EDIT_NAME, m_strName)
		DDX_TEXT(IDC_EDIT_PASSWORD, m_strPassword)
        DDX_TEXT(IDC_EDIT_PASSWORD2, m_strPassword2)
	END_DDX_MAP()

	LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
	LRESULT OnOK(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
	LRESULT OnCancel(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);


	void	RefreshAll();


protected:
	CListViewCtrl	m_lcAccount;
	CString			m_strName;
	CString			m_strPassword;
    CString			m_strPassword2;

public:
	LRESULT OnBnClickedButtonAddUser(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
public:
	LRESULT OnBnClickedButtonDelUser(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
public:
    LRESULT OnLvnItemActivateListAccount(int /*idCtrl*/, LPNMHDR pNMHDR, BOOL& /*bHandled*/);
public:
    LRESULT OnLvnItemchangedListAccount(int /*idCtrl*/, LPNMHDR pNMHDR, BOOL& /*bHandled*/);
public:
    LRESULT OnNMClickListAccount(int /*idCtrl*/, LPNMHDR pNMHDR, BOOL& /*bHandled*/);
};
